package org.dromara.system.domain.vo;

import org.dromara.system.domain.SkyRelationship;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;


/**
 * 天眼查股权关系视图对象 sky_relationship
 *
 * @author Lion Li
 * @date 2024-09-24
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = SkyRelationship.class)
public class SkyRelationshipVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private Long id;

    private String candidateName;

    @ExcelProperty(value = "分标名称",index = 0)
    private String subStandardName;

    @ExcelProperty(value = "包名",index = 1)
    private String bagName;

    /**
     * 开始节点编码
     */
    private String startNode;

    @ExcelProperty(value = "公司/个人名称",index = 2)
    private String startName;

    /**
     * 关系名称
     */
    @ExcelProperty(value = "关系",index = 3)
    private String name;

    /**
     * 占比
     */
    private String percent;

    /**
     * 结束节点编码
     */
    private String endNode;

    @ExcelProperty(value = "关联公司/个人名称",index = 4)
    private String endName;

    /**
     * 类型
     */
    private String dataType;

    /**
     * 项目分包ID
     */
    private Long bagId;

    private String startDataType;

    private String endDataType;

    public void setRelation(SkyRelationshipVo vo) {
        if(vo == null) {
            return;
        }

        this.name = this.name + "->" + this.getEndName() + "->" + vo.getName();
        this.endName = vo.getName();
        this.endNode = vo.getEndNode();
    }

    private List<SkyRelationshipVo> childList;
}
